//
// Created by sgyt on 2020/9/2.
//

#include <stdio.h>
#include <string.h>
#include <unistd.h>

#define CPU_VENDOR_OS "sparc64-unknown-freebsd5.1"
#undef CPU_VENDOR_OS
#define CPU_VENDOR_OS "sparc64-unknown-freebsd5.2"
//AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$host", [CPU, vendor, and operating system])

int main(int argc,char *argv[])
{
    union
    {
        short s;
        char c[sizeof(short)];
    } un;

    un.s = 0x0102;
    printf("%s: ",CPU_VENDOR_OS);

    if(sizeof(short) == 2){
        if(un.c[0] == 1 && un.c[1] == 2)
        {
            printf("big-endian\n");
        }else if(un.c[0] == 2 && un.c[1] == 1){
            printf("little-endian\n");
        }else{
            printf("unknow \n");
        }
    }else{
        printf("sizeof(short) == %d\n", sizeof(short));
    }
    return 1;
}


